package cn.iocoder.yudao.module.yyzx.dal.mysql.check_In;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.yyzx.dal.dataobject.check_In.Check_InDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.yyzx.controller.admin.check_In.vo.*;

/**
 * 入住登记 Mapper
 *
 * @author w
 */
@Mapper
public interface Check_InMapper extends BaseMapperX<Check_InDO> {

    default PageResult<Check_InDO> selectPage(Check_InPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<Check_InDO>()
                .likeIfPresent(Check_InDO::getCustomerName, reqVO.getCustomerName())
                .eqIfPresent(Check_InDO::getCustomerGender, reqVO.getCustomerGender())
                .eqIfPresent(Check_InDO::getCardId, reqVO.getCardId())
                .eqIfPresent(Check_InDO::getRoomId, reqVO.getRoomId())
                .betweenIfPresent(Check_InDO::getInTime, reqVO.getInTime())
                .betweenIfPresent(Check_InDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(Check_InDO::getId));
    }

}